package com.htgd.gardenexpo.service.impl;

import com.htgd.gardenexpo.entity.GeConPartyUpload;
import com.htgd.gardenexpo.dao.GeConPartyUploadDao;
import com.htgd.gardenexpo.service.GeConPartyUploadService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (GeConPartyUpload)表服务实现类
 *
 * @author makejava
 * @since 2021-06-08 17:21:37
 */
@Service("geConPartyUploadService")
public class GeConPartyUploadServiceImpl implements GeConPartyUploadService {
    @Resource
    private GeConPartyUploadDao geConPartyUploadDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public GeConPartyUpload queryById(Integer id) {
        return this.geConPartyUploadDao.queryById(id);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<GeConPartyUpload> queryAllByLimit(int offset, int limit) {
        return this.geConPartyUploadDao.queryAllByLimit(offset, limit);
    }

    @Override
    public List<GeConPartyUpload> queryByPartyId(int id) {
        return this.geConPartyUploadDao.queryByPartyId(id);
    }

    /**
     * 新增数据
     *
     * @param geConPartyUpload 实例对象
     * @return 实例对象
     */
    @Override
    public GeConPartyUpload insert(GeConPartyUpload geConPartyUpload) {
        this.geConPartyUploadDao.insert(geConPartyUpload);
        return geConPartyUpload;
    }

    /**
     * 修改数据
     *
     * @param geConPartyUpload 实例对象
     * @return 实例对象
     */
    @Override
    public GeConPartyUpload update(GeConPartyUpload geConPartyUpload) {
        this.geConPartyUploadDao.update(geConPartyUpload);
        return this.queryById(geConPartyUpload.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.geConPartyUploadDao.deleteById(id) > 0;
    }

    @Override
    public boolean deleteByPartyId(Integer id) {
        return this.geConPartyUploadDao.deleteByPartyId(id) > 0;
    }

    @Override
    public boolean deleteByIds(String[] id,int pid) {
        return this.geConPartyUploadDao.deleteByIds(id,pid) > 0;
    }
}
